import unittest
import HTMLTestRunner
import tools

pathfile = tools.QueryFile.find_path('oaObjDaiFaShiWu.py','..\daifashiwu')
path_str = str(pathfile)
index = path_str.rfind('\\')
res_path = path_str[:index]
print(res_path)


test_list = unittest.defaultTestLoader.discover(rf'{res_path}',pattern='oaObjDaiFaShiWu.py')

file = open('待发事物测试报告.html',mode='ab')

runner = HTMLTestRunner.HTMLTestRunner(stream = file,title='待发事物测试报告',description = '作者:秦吉伟')

runner.run(test_list)